﻿@* TypeVisibility: Internal *@
@model SlamCms.Data.TagTreeNode
@functions {
	IHtmlString GetAdditionalText(SlamCms.Data.TagTreeNode node)
	{
		return (node.ContentItemCount > 0 ? "&nbsp;<span>({0})</span>".F(node.ContentItemCount) : string.Empty).ToHtml();
	}
}
@if (Model.Type == TagTreeNodeType.TagCategory) {
	if (!Model.Text.IsNullOrWhiteSpace()) { 
		<h2>@Model.Text</h2>
	}
} else if (Model.Type == TagTreeNodeType.Tag) {
	<a class="@(Model.IsSelected ? "active" : "")" href="@Model.Url" rel="nofollow">@Model.Text@GetAdditionalText(Model)</a>
}
@if (Model.Children.Any()) {
<ul>
	@foreach (var childNode in Model.Children) {
	<li class="@(childNode.IsSelected ? "selected" : "")">@Html.DisplayFor(m => childNode)</li>
	}
</ul>
}